<html>
<head>
    <title>透析助手</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.5.6/css/sm.min.css">
    <link rel="stylesheet" href="__PUBLIC__/css/style.css">
    <link rel="stylesheet" href="__PUBLIC__/css/5s.css">
    <link rel="stylesheet" href="__PUBLIC__/css/6m.css">
    <link rel="stylesheet" href="__PUBLIC__/css/iconfont.css">
</head>
<body>
	<div class="head head-another">
		<div class="HeadContent">
            <if condition="$pid eq ''">
			<a href="<{:U('Index/index')}>" class="backIndex"><i class="iconfont">&#xe605;</i></a>
            <else />
            <a href="javascript:;" class="back"><i class="iconfont">&#xe605;</i></a>
            </if>
			<a href="javascript:;" class="HeadTitle">饮食列表</a>
		</div>
	</div>
	<div class="RecordInformation-public">
		<ul class="rank_list">
        <empty name="list">
            <li style="padding-top:15px;">暂 无 记 录</li>
        <else />
            <foreach name="list" item="v">
            <li>
                <a href="<{:U('edit',array('id'=>$v['id'],'pid'=>I('get.pid')))}>">
                    <div class="LeftHead">
                        <div class="LeftHead-title"><{$v.time_section}></div>
                        <div class="date"><{$v.create_date}></div>
                    </div>
                    <div class="Right"><i class="iconfont">&#xe60a;</i></div>
                    <div class="LeftFoot">
                        <div class="warning"><{$v.name}></div>
                        <div><{$v.des}></div>
                    </div>
                </a>
			</li>
            </foreach>
        </empty>
		</ul>
	</div>
    <if condition="$pid eq ''">
	<div class="BtnGroup">
		<button class="AddRecord btn-submit" type="button" onclick="location.href='<{:U('edit')}>'">添加记录</button>
	</div>
    </if>
    <!-- 通用弹框开始 -->
    <div class="Popwindow">
        <div class="PopContent">
            <div class="PopContentTitle">危险食物&描述</div>
            <div class="PopContentText">
                <div class="PopContentText-input">
                    <span id="popName"></span>&nbsp;<span id="popDes" style="font-size:14px;color:#888;"></span>
                </div>
                <div class="BtnGroup Btn-Popwindow">
                    <button class="btn-submit" type="button" onclick="javascript:$('.Popwindow').hide();">关闭</button>     
                </div>
            </div>
        </div>
    </div>
    <!-- 通用弹框结束 -->
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.7/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='__PUBLIC__/js/myjq.js'></script>
<script type="text/javascript">
    //无限加载
    var pageNum=1;
    var page_ajax=true;//加载开关
    $(document).ready(function(){
        $(window).scroll(function(){
            var bot = 70; //bot是底部距离的高度
            if ((bot + $(window).scrollTop()) >= ($(document).height() - $(window).height())) {
                if(page_ajax){
                    page_ajax=false;
                    pageNum++;
                    $.get('<{:U("index")}>&p='+pageNum+'&pid='+'<{$pid}>',function(res){
                        if(res){
                            if(res != 'err'){
                                var goodsStr='';
                                $.each(res,function(i,item){
                                    goodsStr+='<li><a href="<{:U(\'edit\')}>&id='+item.id+'&pid=<{:I('get.pid')}>">';
                                    goodsStr+='<div class="LeftHead"><div class="LeftHead-title">'+item.time_section+'</div><div class="date">'+item.create_date+'</div></div><div class="Right"><i class="iconfont">&#xe60a;</i></div><div class="LeftFoot"><div class="warning">'+item.name+'</div><div>'+item.des+'</div></div></a></li>';
                                })
                                $('.rank_list').append(goodsStr);
                                page_ajax=true;
                            }
                        }
                    },'json');
                }
            }
        });
    });
    //医生或营养师查看危险食物和食物描述
    function showPop(name,des){
        $('#popName').text(name);
        $('#popDes').text(des);
        $('.Popwindow').show();
    }
</script>
</body>
</html>